package com.baidu.user.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baidu.user.bean.User;
import com.baidu.user.dao.UserDao;

@Service
public class UserService {

	@Autowired
	private UserDao dao;

	public List getList() {
		
		return dao.getList();
	}

	public boolean addReg(User user) {
		
		int i = dao.addReg(user); 
		
		if(i>0){
			
			return true;
		}
		
		return false;
	}

	public boolean addMail(User user) {
		
		int i = dao.addMail(user); 
		
		if(i>0){
			
			return true;
		}
		
		return false;
	}

	public User checkTel(User user) {
		
		return dao.checkTel(user);
	}

	public User checkMail(User user) {
		
		return dao.checkMail(user);
	}

	public int getMaxUid() {
		
		return dao.getMaxUid();
	}

	public boolean add_user(User user) {
		
		int i = dao.add_user(user);
		
		if(i > 0) {
			
			return true;
		}else{
			
			return false;
		}
		
		 
	}

	public User getUser(int id) {
		
		return dao.getUser(id);
	}

}
